UNPKG

667 BPlain TextView Raw
1import { FetchData, TFetchActionEvent, TFetchPromise } from '@bearer/functions'
2// Uncomment the line below to use the API Client
3// import Client from './client'
4
5export default class {{functionClassName}}Function extends FetchData implements FetchData<ReturnedData, any> {
6 async action(event: TFetchActionEvent<Params>): TFetchPromise<ReturnedData> {
7 // Put your logic here
8 return { data: [] }
9 }
10
11 // Uncomment the line below to restrict the function to be called only from a server-side context
12 // static serverSideRestricted = true
13
14}
15
16/**
17 * Typing
18 */
19export type Params = {
20 // name: string
21}
22
23export type ReturnedData = {
24 // foo: string[]
25}